package com.wsjzzcbq.qianyuan.sys.controller;

import com.wsjzzcbq.qianyuan.common.bean.R;
import com.wsjzzcbq.qianyuan.sys.service.SysFileService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * FileController
 *
 * @author wsjz
 * @date 2022/03/14
 */
@RequestMapping("/sys/file")
@RestController
public class SysFileController {

    @Autowired
    private SysFileService sysFileService;

    @CrossOrigin(allowedHeaders = {"*"},origins={"http://localhost:9090"})
    @RequestMapping("/upload")
    public R<?> upload(MultipartFile file) {
        return sysFileService.sysFileUpload(file);
    }
}
